package com.example.demo.feign;

import com.example.demo.fallback.ApiFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "circuit-breaker", url = "http://localhost:${server.port}", fallbackFactory = ApiFeignFallbackFactory.class)
public interface ApiFeign {

    @GetMapping("/feignMethod/{ok}")
    String feignMethod(@PathVariable boolean ok);

    @GetMapping("/feign/{ok}")
    String feign(@PathVariable boolean ok);

}
